<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>添加物料出库规则</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/form.css"/>
	</head>
	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
	            <p class="contentText local"><span>位置：库存规则管理 > 物料出库规则  > 添加物料出库规则</span></p>
	            
			    	<div class="article_list">
			            <!------- 内容 ------->
			            <div class="content content1" style="width: 99.6%;margin: 0px auto;">
							<!-- 列表展示区 -->
							<div class="table_border">
				                <div class="show_list">
				                	<div class="title_operate">
				                    	<h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>物料出库规则设置</span></h4>
				                		
				                        <!-- 操作类型区 -->
				                        <div class="operate_area" id="addOperate">
				                            <a id="addDetail" onclick="addDetail()" class="bgd_add img_hand">增加</a> 
				                            <a id="deleteDetail" onclick="deleteDetail()" class="bgd_delete img_hand">删除</a> 
				                            <!--<a id="updateDetail" onclick="updateDetail()" class="bgd_update img_hand">修改</a>--> 
				                            <a id="saveDetail" onclick="saveRule()" class="bgd_blue_two img_hand">保存</a> 
				                            <a id="backDetail" href="outstockRuleList.html" class="bgd_white_two img_hand">返回</a> 
				                        </div>
				                	</div>
				                	<div class="list_area">
				                        <!-- 信息列表区 -->
				                        <div class="info_area">
				                            <table class="tablelist" border="1" cellspacing="0" cellpadding="0">
				                                <tbody>
				                                    <tr class="menuText list_head">
				                                    	<th class="checkSelectAll"></th>
				                                        <th class="">规则名称</th>
				                                        <th class="">物料名称</th>
				                                        <th class="">物料编码</th>
				                                        <th class="">物料类型</th>
				                                        <th class="">物料规格</th>
				                                        <th class="">物料型号/牌号/材料</th>
				                                        <th class="">出库规则</th>
				                                        <th class="">创建人</th>
				                                        <th class="">创建日期</th>
				                                    </tr>
				                                </tbody>
				                                <tbody class="tablelist" id="addTr">
				                                    <tr class="listTableText list_list">
				                                    	<td><input type="checkbox" class="input_checkBox" name="" id="" value=""></td>
				                                        <td><input type="text" id="" value="" /><span class="redColor">*</span></td>
				                                        <td><input type="text" id="" value="" /></td>
				                                        <td><input type="text" id="" value="" /></td>
				                                        <td><input type="text" id="" value="" /></td>
				                                        <td><input type="text" id="" value="" /></td>
				                                        <td><input type="text" id="" value="" /></td>
				                                        <td>
				                                        	<select name="">
				                                        		<option value="">先入先出（默认）</option>
				                                        		<option value="">后入先出</option>
				                                        		<option value="">无</option>
				                                        	</select>
				                                        </td>
				                                        <td><input type="text" name="" value="超级管理员" /></td>
				                                        <td><input type="text" name="" value="2018-09-16" /></td>
				                                    </tr>
				                                </tbody>
				
				                            </table>
				                        </div>
				                    </div>
				                </div>
							</div>
			            </div>
			        </div>
			        
			    </div>
			</div>
			
			<!-- 版尾  -->
			<div class="ending">
				Copyright© 2017-2018 磐基技术有限公司
			</div>
		</div>
	</body>
	<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/layui.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var h = document.documentElement.clientHeight;
		$(".wrap").css("height", h);
		
		// 获取每行 td 的兄弟节点
		$("#metailInfo td").hover(   
			function () {      
				$(this).parent().children().addClass("td_hover");
			},    
			function () {      
				$(this).parent().children().removeClass("td_hover");  
			}
		);
		
		//-------- 增加明细 ---------
	    function addDetail() {
	        
	        var dom = "<tr class='contentText list_list'><td><input type='checkbox' class='input_checkBox' name='' id='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''><span class='redColor'>*</span></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><select name=''><option value=''>先入先出（默认）</option><option value=''>后入先出</option><option value=''>无</option></select></td>";
	        dom += "<td><input type='text' name='' value='超级管理员'></td>";
	        dom += "<td><input type='text' name='' value='2018-09-16'></td></tr>";
	        
	        $("#addTr").append(dom);
	    }
		
		//-------- 删除明细 ---------
	    function deleteDetail() {
	        var checks = $("input[type='checkbox']:checked");
	        if (checks.length == 0) {
	            $("#addTr").find("tr:last").remove();
	        } else {
	            $.each(checks, function(item, obj) {
	                $(obj).parent().parent().remove();
	            });
	        }
	    }

	</script>
</html>
